home *** CD-ROM | disk | FTP | other *** search
/ Champak 119 / (Vol 119) Nov 09 2010.iso / Games / soccer_skill.swf / scripts / frame_122 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  85 lines

  1. t = Number(t) + 0.1;
  2. oldx = x;
  3. oldy = y;
  4. x = getProperty("Ball", _X);
  5. y = getProperty("Ball", _Y);
  6. vy = Number(vy) + Number(g / 10);
  7. x = Number(x) + Number(vx / 10);
  8. y = Number(y) + Number(vy / 10);
  9. if(Number(280 - BallRadius) < Number(y))
  10. {
  11.    y = 280 - BallRadius;
  12.    vx *= elastic;
  13.    vy = (- vy) * elastic;
  14.    if(mejorpuntaje > 0 && puntos > 0)
  15.    {
  16.       tellTarget("boo")
  17.       {
  18.          play();
  19.       }
  20.    }
  21.    if(mejorpuntaje < puntos)
  22.    {
  23.       mejorpuntaje = puntos;
  24.    }
  25.    puntos = 0;
  26.    random = random(2);
  27. }
  28. if(Number(x) < Number(BallRadius))
  29. {
  30.    x = BallRadius;
  31.    vx = (- vx) * elastic;
  32.    vy *= elastic;
  33. }
  34. if(Number(400 - BallRadius) < Number(x))
  35. {
  36.    x = 400 - BallRadius;
  37.    vx = (- vx) * elastic;
  38.    vy *= elastic;
  39. }
  40. setProperty("Ball", _X, x);
  41. setProperty("Ball", _Y, y);
  42. setProperty("sombra", _X, x);
  43. setProperty("diego", _X, x);
  44. setProperty("Ball.bola", _rotation, x);
  45. if(y < 230)
  46. {
  47.    setProperty(diego.diegohead, _rotation, (y * -1 + 240) / 2.5);
  48. }
  49. frame = int(y);
  50. tellTarget("sombra")
  51. {
  52.    gotoAndStop(eval("../:frame"));
  53. }
  54. if(puntos == 1)
  55. {
  56.    tellTarget("ova")
  57.    {
  58.       play();
  59.    }
  60. }
  61. if(puntos == 5)
  62. {
  63.    if(random == "0")
  64.    {
  65.       tellTarget("ole")
  66.       {
  67.          play();
  68.       }
  69.    }
  70.    else if(random == "1")
  71.    {
  72.       tellTarget("veni")
  73.       {
  74.          play();
  75.       }
  76.    }
  77.    if(puntos == 15)
  78.    {
  79.       tellTarget("pele")
  80.       {
  81.          play();
  82.       }
  83.    }
  84. }
  85.